package com.example.demo.swagger.chenxue;


import com.example.demo.annotation.MyLog;
import com.example.demo.properties.AddressProps;
import com.example.demo.vo.AddressVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/address")
@Api(tags = "地址信息", value = "AddressController", description = "地址信息的增删改查")
/**
 * @author: YanMing.Wang
 * @date: 2024-02-28
 * @desp: 接口类:AddressController,在swagger页面,tags分组展示,如果方法有tags,会单独分组(类分组和方法分组都有方法接口)
 * 如果类tags=方法tags,此时会合并去重成一个分组
 */
public class AddressController {

    @Autowired
    private AddressProps props;


    @RequestMapping(value = "/getAddressVO", method = RequestMethod.GET)
    @ApiOperation(value = "获取AddressVO信息", notes = "查询方法:用于获取AddressVO信息,包括省市县内容", httpMethod = "GET", tags = "查询")
    @MyLog(value = "获取AddressVO信息")
    public AddressVO getAddressVO() {
        AddressVO vo = new AddressVO();
        vo.setProvince(props.getProvince());
        vo.setCity(props.getCity());
        vo.setCounty(props.getCounty());
        return vo;
    }

}
